package com.csy.property.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.csy.property.community.domain.AjUnit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * @Auther: sunxx
 * @Date: 2024/4/22 - 04 - 22 - 18:10
 * @Description: com.sxx.ajcommunity.community.mapper
 * @version: 1.0
 */
@Mapper
public interface AjUnitMapper extends BaseMapper<AjUnit> {
    /*@Select("<script>SELECT \n" +
            "    *,\n" +
            "    ac.`community_name` AS communityName,\n" +
            "    ab.`building_name` AS buildingName,\n" +
            "FROM aj_unit au \n" +
            "LEFT JOIN aj_community ac ON au.`community_id` = ac.`community_id`\n" +
            "LEFT JOIN aj_building ab ON au.`building_id` = ab.`building_id`\n" +
            "<where>" +
            "<if test=\"unitName !=null and unitName != ''\">" +
            "au.unit_name like concat('%',#{unitName},'%')" +
            "</if> " +

            "<if test=\"unitCode !=null and unitCode != ''\">" +
            "and au.unit_code = #{unit_code}" +
            "</if> " +

            "<if test=\"unitHaveElevator !=null and unitHaveElevator != ''\">" +
            "and au.unit_have_elevator = #{unit_have_elevator}" +
            "</if> " +

            "<if test=\"buildingId !=null and buildingId != ''\">" +
            "and au.building_id = #{building_id}" +
            "</if> " +
            "</where>"+
            "</script>")*/
    List<AjUnit> selectUnitList(AjUnit ajUnit);

    AjUnit selectById(Long unitId);
    int myUpdateById(AjUnit ajUnit);

    int deleteBatchIds(@Param("ids")List<Long> ids);
}
